<template>
    <el-aside width="210px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-active="open_index" @select="openIndexHandle">
            <el-submenu index="11">
                <template slot="title"><i class="iconfont icon-kehuqunzu"></i> 客户管理</template>
                <el-menu-item-group>
                    <el-menu-item index="1" @click="goto('customerInfo')">客户信息</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="22">
                <template slot="title"><i class="iconfont icon-zaixianchongzhi"></i> 充值管理</template>
                <el-menu-item-group>
                    <el-menu-item index="2" @click="goto('whatfuckeryouwannago')">会员充值</el-menu-item>
                    <el-menu-item index="3" @click="goto('whatfuckeryouwannago')">充值记录</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="33">
                <template slot="title"><i class="iconfont icon-consumption"></i> 消费管理</template>
                <el-menu-item-group>
                    <el-menu-item index="4" @click="goto('whatfuckeryouwannago')">结账管理</el-menu-item>
                    <el-menu-item index="5" @click="goto('whatfuckeryouwannago')">消费查询</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="44">
                <template slot="title"><i class="iconfont icon-goods-copy"></i> 商品管理</template>
                <el-menu-item-group>
                    <el-menu-item index="6" @click="goto('whatfuckeryouwannago')">商品管理</el-menu-item>
                    <el-menu-item index="7" @click="goto('whatfuckeryouwannago')">商品类别管理</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="55">
                <template slot="title"><i class="iconfont icon-fl-dingdan"></i> 订单管理</template>
                <el-menu-item-group>
                    <el-menu-item index="8" @click="goto('whatfuckeryouwannago')">订单管理</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="66">
                <template slot="title"><i class="iconfont icon-fl-shuju"></i> 数据分析</template>
                <el-menu-item-group>
                    <el-menu-item index="9" @click="goto">客户等级统计</el-menu-item>
                    <el-menu-item index="10" @click="goto">到店频率统计</el-menu-item>
                    <el-menu-item index="11" @click="goto">到店时间统计</el-menu-item>
                    <el-menu-item index="12" @click="goto">客户区域统计</el-menu-item>
                    <el-menu-item index="13" @click="goto">关键词搜索统计</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
        </el-menu>
    </el-aside>
</template>
<script>
    import { mapState, mapMutations, mapActions } from 'vuex';
    import store from '../../vuex/store'
    export default {
        name: 'Left',
        data() {
            return {
                open_index: sessionStorage.getItem('openIndex') || '',// 当前打开菜单的index
            }
        },
        methods: {
            goto(path) {
                this.$router.push({ name: path })
            },
            openIndexHandle(data, indexPath) {
                sessionStorage.setItem('openIndex', data)
            }
        }
    }

</script>
<style>
    .el-menu-item-group__title {
        display: none
    }
</style>